5 REM -- FROM ELEMENTRY BASIC BY HENRY LEGARD & ANDREW SINGER
10 REM --THIS PROGRAM READS IN A MESSAGE AND ENCIPHERS EACH 
20 REM --LETTER BASED ON THE LETTER AND THE NEXT LETTER OF A
30 REM --KEYWORD. THE ENCIPHER LETTER IS OBTAINED FRON A TABLE
40 REM --OF LETTER PAIRS
50 REM
60 REM --THE PROGRAM PRINTS THE ENCIPHERED LETTER
70 REM --DICTIONARY OF NAMES:
80 REM 
90 REM
100 REM -- R		A ROW NUMBER
110 REM -- C		A COLUMN NUMBER
120 REM -- I		INDEX OF NEXT KEYWORD LETTER
130 REM -- K$		THE ARRAY OF KEYWORD LETTERS
140 REM -- T$		THE TABLE OF CIPHER LETTER PAIRS
150 REM -- C1$		A CHARACTER IN THE INPUT MESSAGE
160 REM -- C2$		A CHARACTER IN THE  KEYWORD
170 REM -- C3$		A CHARACTER IN THE OUTPUT MESSAGE
180 REM -- 
190 DIM K$(6), T$(26,26)
200 REM
210 REM
220 REM -- SET UP TABLES
230 FOR I = 1 TO 6
240     READ K$(I)
250 NEXT I
260 FOR R = 1 TO 26
270     FOR C = 1 TO 26
280          READ T$(R,C)
290     NEXT C
300 NEXT R
310 REM
320 REM -- ENCIPHER MESSAGE
330 PRINT "ENTER MESSAGE CHARACTERS"
340 LET I = 1
350 INPUT C1$
360 IF C1$ = "/" THEN 510
370 LET C2$= K$(I)
380 REM -- CONVERT LETTERS TO ROW AND COLUMN NUMBERS --
390 LET R = ASC(C2$) - 64
400 LET C = ASC(C1$) - 64
410 LET C3$ = T$(R,C)
420 PRINT C3$
430 IF I = 6 THEN 460
440 LET I = I + 1
450 GOTO 480
460 LET I = 1
470 GOTO 480
480 INPUT C1$
490 GOTO 360
500 REM
510      PRINT "CIPHERING COMPLETE"
520      STOP
530 REM
540 REM
550 REM
560 DATA W,A,T,S,O,N
570 REM
580 DATA H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G
590 DATA I,J,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